Class Event
- java.lang.Object
-
- MusicLandscape.entities.Event
-
-
Field Summary
Fields Modifier and Type Field Description private Artistartistthe artist who appeared at this event the artist of an event cannot be nullprivate intattendeesthe number of attendees of this event.private Datedatethe date on which this event takes placeprivate java.lang.Stringdescriptiondescription of this eventprivate Venuevenuethe venue at which this event takes place
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ArtistgetArtist()gets the artist of this eventintgetAttendees()gets the number of attendees of this eventDategetDate()gets the date of this eventjava.lang.StringgetDescription()gets the description of this eventVenuegetVenue()gets the venue of this eventintimpact()returns the impact of this eventvoidsetArtist(Artist artist)sets the artist of this eventvoidsetAttendees(int attendees)sets the number of attendees of this eventvoidsetDate(Date date)sets the date of this eventvoidsetDescription(java.lang.String description)sets the description of this eventvoidsetVenue(Venue venue)sets the venue of this eventjava.lang.StringtoString()returns a String representation of this event
-
-
-
Field Detail
-
artist
private Artist artist
the artist who appeared at this event the artist of an event cannot be null
-
attendees
private int attendees
the number of attendees of this event.
-
date
private Date date
the date on which this event takes placea null date represents an unknown date
-
description
private java.lang.String description
description of this eventdefault description is an empty String
-
venue
private Venue venue
the venue at which this event takes placea null venue represents an unknown venue
-
-
Constructor Detail
-
Event
public Event()
creates a default eventa default event has a default artist and an empty description. all other information is unknown (See docu for fields)
-
Event
public Event(Event e)
creates a deep copy of an event- Parameters:
e- the event to copy
-
-
Method Detail
-
getArtist
public Artist getArtist()
gets the artist of this event- Returns:
- the artist
-
setArtist
public void setArtist(Artist artist)
sets the artist of this eventthe artist of an event cannot be null
- Parameters:
artist- the artist to set
-
getAttendees
public int getAttendees()
gets the number of attendees of this event- Returns:
- the attendees
-
setAttendees
public void setAttendees(int attendees)
sets the number of attendees of this eventthe number of attendees must be a non-negative number. When called with invalid arguments this event remains unchanged.
- Parameters:
attendees- the attendees to set
-
getDate
public Date getDate()
gets the date of this eventthis method is defensive in the sense that it returns a copy of the date
- Returns:
- the date
-
setDate
public void setDate(Date date)
sets the date of this eventan unknown date is represented by a null date. this method is defensive in the sense that this event keep a copy of the original date
- Parameters:
date- the date to set
-
getDescription
public java.lang.String getDescription()
gets the description of this event- Returns:
- the description
-
setDescription
public void setDescription(java.lang.String description)
sets the description of this eventdescription can not be null
- Parameters:
description- the description to set
-
getVenue
public Venue getVenue()
gets the venue of this event- Returns:
- the Venue
-
setVenue
public void setVenue(Venue venue)
sets the venue of this event- Parameters:
venue- the venue to set
-
toString
public java.lang.String toString()
returns a String representation of this eventthe string representation of an event is (without quotes, but including line breaks):
"artist" @ "venue name" on "date" "description" ("attendees" attending ("impact"))if a value is not available, replace it with "unknown"
- Overrides:
toStringin classjava.lang.Object- Returns:
- a String representation of this event
-
impact
public int impact()
returns the impact of this eventthe impact is an estimation of the number of people who took notice of this event for a generic event, the impact is the number of attendees times 2.
- Returns:
- the impact
-
-